function doCreateOrder() {
	
	var itemId = $("#itemId").val();
	var marketId = $("#marketId").val();
  //  var itemAmount = $("#age").val();

    //编辑
    $.ajax({
        url: "/createOrder",
        data: {
            "itemId": itemId,
            "itemAmount":1,
            "marketId":marketId
        },
        type: "POST",
        cache: false,
        success: function (data) {   //返回的是 ResponseType:status\data
            if (data.status == "success") {
               alert("下单成功!");
               var index=parent.layer.getFrameIndex(window.name);
           	   parent.layer.close(index);
           	   parent.location.reload(false);
            } else {
            	alert("下单失败,原因是:"+data.data.errMsg);    //data.data :返回BaseExcpController中的responseData
            	if(data.data.errCode == "10002"){  //"10002" :状态码为1002,表示用户还未登陆
            		window.location.href="/doLogin";
            		//window.location.assign("/doLogin");  作用一致,只是用法不同
            	}
            }
        }
    })
}



